package demo2;

import java.util.*;

public class Test {
    public static void main(String[] args) {
        Map<Integer,Integer> map = new HashMap<>();
        int[] array = {1,2,3,4,1,1,1,1,2,2,5,3,3,4};
        for (int i = 0; i < array.length; i++) {
            map.put(array[i],map.getOrDefault(array[i],0)+1);
        }
        System.out.println(map);


    }
    public static void main1(String[] args) {
        Set<Integer> set = new HashSet<>();
        Scanner input = new Scanner(System.in);
        int k = 5;
        while (input.hasNextInt()) {
            if (k-- <= 0) {
                break;
            }
            set.add(input.nextInt());
        }
        System.out.println(set);
    }
}
